<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #nav,#main{
            width: 540px;
            margin: 0 auto;

        }
        #main{
            height: 500px;
            background-color: orange;
        }
        #nav{
            background-color: green;
            /* overflow: hidden; */
            /* height: 50px; */
        }
        #nav a{
            float: left;
            width: 100px;
            height: 50px;
            /* background-color: red; */
            text-align: center;
            line-height: 50px;
            margin-right: 10px;
            text-decoration: none;
        }
        a:hover{
            background-color: pink;
        }
        #nav .no-margin{
            margin:0;
        }
        #nav .clear{
            clear: both;
        }
    </style>
</head>
<body>
    <div id="nav">
        <a href="">淘宝</a>
        <a href="">淘宝</a>
        <a href="">淘宝</a>
        <a href="">淘宝</a>
        <a href="" class="no-margin">淘宝</a>
        <div class="clear"></div>
    </div>
    <div id="main"></div>
</body>
</html>